// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_HR_MONTH_SALARY_ITEM
// * CreateDate    : 2013-08-28 11:00:56
// * Creater       : CodeSmith
// * LastChangeDate: 2013-08-28 11:00:56
// * LastChanger   : 2013-08-28 11:00:56
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Hr
{
/// <summary>
    /// HrMonthSalaryItem
    /// </summary>
    public partial class HrMonthSalaryItemBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objHrMonthSalaryItemEntity">Entity</param>
        /// <returns>Entity</returns>
        public static HrMonthSalaryItemEntity GetHrMonthSalaryItem(HrMonthSalaryItemEntity objHrMonthSalaryItemEntity)
        {
            return DataAccess.SelectSingle<HrMonthSalaryItemEntity>(objHrMonthSalaryItemEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objHrMonthSalaryItemEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertHrMonthSalaryItem(HrMonthSalaryItemEntity objHrMonthSalaryItemEntity)
        {
            return DataAccess.Insert(objHrMonthSalaryItemEntity);
        }

        public static bool InsertHrMonthSalaryItem(List<HrMonthSalaryItemEntity> objHrMonthSalaryItemEntityList)
        {
            return DataAccess.Insert(objHrMonthSalaryItemEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objHrMonthSalaryItemEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateHrMonthSalaryItem(HrMonthSalaryItemEntity objHrMonthSalaryItemEntity)
        {
            return DataAccess.Update(objHrMonthSalaryItemEntity);
        }

        public static bool UpdateHrMonthSalaryItem(List<HrMonthSalaryItemEntity> objHrMonthSalaryItemEntityList)
        {
            return DataAccess.Update<HrMonthSalaryItemEntity>(objHrMonthSalaryItemEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objHrMonthSalaryItemEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteHrMonthSalaryItem(HrMonthSalaryItemEntity objHrMonthSalaryItemEntity)
        {
            return DataAccess.Delete(objHrMonthSalaryItemEntity);
        }

        public static bool DeleteHrMonthSalaryItem(List<HrMonthSalaryItemEntity> objHrMonthSalaryItemEntityList)
        {
            return DataAccess.Delete<HrMonthSalaryItemEntity>(objHrMonthSalaryItemEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetHrMonthSalaryItemAll()
        {
            return DataAccess.SelectAllDataSet<HrMonthSalaryItemEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<HrMonthSalaryItemEntity> GetHrMonthSalaryItemAllList()
        {
            return DataAccess.SelectAll<HrMonthSalaryItemEntity>();
        }
        #endregion

        public static DataTable GetHrMonthSalaryItem(string monthSalaryId)
        {
            if (string.IsNullOrEmpty(monthSalaryId))
            {
                return null;
            }
            string sql = @"SELECT * FROM HR_MONTH_SALARY_ITEM WHERE MONTH_SALARY_ID = '" + monthSalaryId + "'";
            DataSet ds = DataAccess.SelectDataSet(sql);
            if (ds != null && ds.Tables.Count > 0)
            {
                return ds.Tables[0];
            }
            return null;
        }

        public static List<HrMonthSalaryItemEntity> GetHrMonthSalaryItemList(string monthSalaryId)
        {
            if (string.IsNullOrEmpty(monthSalaryId))
            {
                return null;
            }
            HrMonthSalaryItemEntity entity = new HrMonthSalaryItemEntity();
            entity.MonthSalaryId = monthSalaryId;
            return DataAccess.Select<HrMonthSalaryItemEntity>(entity);
        }

        public static HrMonthSalaryItemEntity GetHrMonthSalaryItemById(string itemId)
        {
            if (string.IsNullOrEmpty(itemId))
            {
                return null;
            }
            HrMonthSalaryItemEntity entity = new HrMonthSalaryItemEntity();
            entity.ItemId = itemId;
            return DataAccess.SelectSingle<HrMonthSalaryItemEntity>(entity);
        }
	}
	
	
}	

